home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / GRAPHICS.SWG / 0012_Display Text in Graphics.pas < prev    next >
Pascal/Delphi Source File  |  1993-08-27  |  1KB  |  40 lines

  1. {
  2. RAPHAEL VANNEY
  3.  
  4. *You mean displaying Text While in Graphics mode :-) ?
  5.  
  6. > Yup. Already got a suggestion on using 640x480 With 8x8 font, so if
  7. > you have any other one please do tell.. ttyl...
  8.  
  9. Sure. Just call the BIOS routines to display Characters With a "standard"
  10. look. By standard look, I mean they look like they were Characters in
  11. Text mode.
  12.  
  13. Okay, here is the basic Procedure to display a String (Works in any Text/
  14. Graphics mode) :
  15. }
  16.  
  17. Procedure BIOSWrite(Str : String; Color : Byte); Assembler;
  18. Asm
  19.   les  di, Str
  20.   mov  cl, es:[di]     { cl = longueur chane }
  21.   inc  di              { es:di pointe sur 1er caractre }
  22.   xor  ch, ch          { cx = longueur chane }
  23.   mov  bl, Color       { bl:=coul }
  24.   jcxz @ExitBW         { sortie si Length(s)=0 }
  25.  @BoucleBW:
  26.   mov  ah, 0eh         { sortie TTY }
  27.   mov  al, es:[di]     { al=caractre  afficher }
  28.   int  10h             { et hop }
  29.   inc  di              { caractre suivant }
  30.   loop @BoucleBW
  31.  @ExitBW:
  32. end ;
  33.  
  34. {
  35. I'm not sure how to manage the background color in Graphics mode ; maybe
  36. you should experiment With values in "coul", there could be a magic bit
  37. to keep actual background color.
  38. }
  39.  
  40.